package com.bdqn.springboot.contorller;

import com.bdqn.springboot.entity.User;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.PropertySource;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import javax.xml.ws.RespectBinding;
@RestController
@PropertySource("classpath:database.properties")
public class HelloSpringBoot {
    @Value("${driver}")
    private String name;
    @Value(("${age}"))
    private String age;
    @Resource
    private User user;
    @RequestMapping("test")
    public String test(){
        return "hello Spring boot";
    }

    @RequestMapping("test2")
    public String test2(){
        return "hello spring boot!name="+name+",age="+age;
    }
    @RequestMapping("test3")
    public String test3(){
        return "hello spring boot!name="+user.getUname()+",age="+user.getAge();
    }
}
